#include<iostream>

using namespace std;

int main()
{
    int arr[5]={1, 5 ,3 ,2 ,4};
    cout<<"数组元素逆置前："<<endl;
    for (int i = 0; i < 5; i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<endl;
    
    int start   = 0;
    int end     = sizeof(arr)/sizeof(arr[0])-1;
    
    while(start < end)
    {
        int temp = arr[start];
        arr[start] = arr[end];
        arr[end] = temp;
        start++;
        end--;
    }
    cout<<"数组元素逆置后："<<endl;
    for (int i = 0; i < 5; i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<endl;
    
    
    return 0;
    
}